package com.jron.cqiu.jna;

import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;

/**
 * Created by Intellij IDEA.
 *
 * @Author: Yejw
 * @Date: 2008-6-11
 * @Time: 22:18:50
 */
public class HelloWorld {
    public interface CLibrary extends Library {
        CLibrary INSTANCE = (CLibrary)
                Native.loadLibrary((Platform.isWindows() ? "msvcrt" : "c"), CLibrary.class);

        void printf(String format, Object... args);
    }

    public static void main(String[] args) {
        args = new String[]{"sss","ttt","kkk"};
        CLibrary.INSTANCE.printf("Hello, World\n");
        for (int i = 0; i < args.length; i++)
            CLibrary.INSTANCE.printf("Argument %d: %s\n", i, args[i]);
    }
}
